local sk_le__wusheng = fk.CreateSkill {

  name = "sk_le__wusheng",

  tags = {  },

}



sk_le__wusheng:addEffect("viewas", {
  name = "sk_le__wusheng",
  anim_type = "offensive",
  pattern = "slash",
  prompt = "#sk_le__wusheng",
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).color == Card.Red
  end,
  view_as = function(self, player,cards)
    if #cards ~= 1 then return end
    local card = Fk:cloneCard("slash")
    card.skillName = sk_le__wusheng.name
    card:addSubcard(cards[1])
    return card
  end,
})

sk_le__wusheng:addEffect(fk.TargetSpecified, {
  name = "#sk_le__wusheng_trigger",
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk_le__wusheng.name) and
      data.card.trueName == "slash" and table.contains(data.card.skillNames, "sk_le__wusheng")
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(1, "sk_le__wusheng")
    if player.dead or player:isKongcheng() then return end
    local cards = room:askForDiscard(player, 1, 3, false, "sk_le__wusheng", true, ".|.|.|hand", "#sk_le__wusheng-discard::"..data.to.id)
    local n = #cards
    if n > 0 then
      data.additionalDamage = (data.additionalDamage or 0) + n
      local to = data.to
      if not to.dead then
        room:askForDiscard(to, n, n, true, "sk_le__wusheng", false)
      end
      if not player.dead and player.phase == Player.Play then
        room:addPlayerMark(player, MarkEnum.SlashResidue.."-phase", n)
      end
    end
  end,
})

return sk_le__wusheng